Skip to content

feat(setup): honor AI_GATEWAY_BASE_URL when validating the gateway key#319

Open
brycedbjork wants to merge 1 commit into
vercel:mainfrom
brycedbjork:feat/gateway-base-url-env
Open

feat(setup): honor AI_GATEWAY_BASE_URL when validating the gateway key#319
brycedbjork wants to merge 1 commit into
vercel:mainfrom
brycedbjork:feat/gateway-base-url-env

Conversation

@brycedbjork

Copy link
Copy Markdown

Summary

validateGatewayApiKey constructs an @ai-sdk/gateway provider with no baseURL, so the AI_GATEWAY_API_KEY check always runs against ai-gateway.vercel.sh. This forwards the AI_GATEWAY_BASE_URL environment variable to createGateway, so anyone running eve against a self-hosted or proxied AI Gateway can validate their key against the same endpoint they actually use.

const provider = createGateway({
  apiKey,
  baseURL: process.env.AI_GATEWAY_BASE_URL,
  fetch: ...,
});

createGateway already treats an undefined/empty baseURL as "use the default", so there is no behavior change when the variable is unset.

Notes

  • Pairs with feat(provider/gateway): support AI_GATEWAY_BASE_URL env for the base URL ai#16401, which adds the same AI_GATEWAY_BASE_URL fallback inside @ai-sdk/gateway itself (covering the default/global provider used for runtime inference). This makes eve's own createGateway call honor it directly, without waiting on that release.
  • The setup-time model-listing endpoints (gateway-models.ts / model-catalog.ts) go through vercel curl against the /v1/models API — a separate code path and endpoint — so they're intentionally left out of this change. Happy to follow up on those if desired.

validateGatewayApiKey built an @ai-sdk/gateway provider with no baseURL, so it
always hit ai-gateway.vercel.sh. Forward AI_GATEWAY_BASE_URL to createGateway so
the key check can target a self-hosted or proxied gateway. No behavior change
when the variable is unset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@brycedbjork is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant